<?php
class fe_loader extends CI_Model {
	function fe_loader() {
		parent::__construct();
		$this->load->database();
	}
		
	function loadTable($tname, $id=0) {
		if($id==0) {
			$this->db->order_by("create_on", "desc");
			$query = $this->db->get ( $tname );
			return $query->result_array ();
		}else {
			$this->db->where('id', $id);
			$query = $this->db->get($tname);
			return $query->row_array();
		}
	}
}

